package com.itheima.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.itheima.core.dao.AdminDao;
import com.itheima.core.po.Admin;
import com.itheima.core.po.User;

@Service("adminServcie")
@Transactional
public class AdminServiceImpl implements AdminService{

	@Autowired
	private AdminDao admindao;
	
	@Override
	public Admin findAdmin(String admin_zhanghao, String admin_password) {
		Admin admin = this.admindao.findAdmin(admin_zhanghao, admin_password);
		return admin;
	}

	@Override
	public List<User> checkusermassage() {
		List<User> users = this.admindao.checkusermassage();
		return users;
	}

	public void  deleteUser(Integer user_id) {
		this.admindao.deleteUser(user_id);
	}

	@Override
	public Integer changesrmassage(User user) {
		int i = this.admindao.changesrmassage(user);
		return i;
	}

	@Override
	public Integer deleteadminmassage(String admin_zhanghao) {
		int i = this.admindao.deleteadminmassage(admin_zhanghao);
		return i;
	}

	@Override
	public List<String> findAllUserzhanghao() {
		List<String> zhanghaos = this.admindao.findAllUserzhanghao();
		return zhanghaos;
	}

	@Override
	public Integer addUser(User user) {
		int i = this.admindao.addUser(user);
		return i;
	}

}
